#include "instructionwidget.h"

instructionwidget::instructionwidget(QWidget *parent) : QWidget(parent)
{
    interface=new QLabel;
    QPixmap p2=QPixmap("3.png");
    interface->setPixmap(p2);

    int x=p2.width(),y=p2.height();

    picture[0]=new QLabel;
    QPixmap pic1=QPixmap("Tom.png");
    picture[0]->setPixmap(pic1);

    picture[1]=new QLabel;
    QPixmap pic2=QPixmap("Jerry.png");
    picture[1]->setPixmap(pic2);


    instruction[0]=new QLabel("Tom，一只蓝灰色家猫，身高约70cm，技能：变成方块。",interface);
    instruction[1]=new QLabel("Jerry，一只棕毛花枝鼠，身高约10cm,技能:变成方块。",interface);

    instruction[0]->setFixedSize(100,100);
    instruction[1]->setFixedSize(100,100);

    instruction[0]->setAlignment(Qt::AlignLeft | Qt::AlignTop);
    instruction[1]->setAlignment(Qt::AlignLeft | Qt::AlignTop);

    instruction[0]->setWordWrap(true);
    instruction[1]->setWordWrap(true);

    instruction[0]->setStyleSheet("background-color:white; border: black;font-family: 楷体; font-size: 15px; color: #4148FF;");
    instruction[1]->setStyleSheet("background-color:white; border: black;font-family: 楷体; font-size: 15px; color: #4148FF;");

    back=new QPushButton("返回",interface);
    back->setFixedSize(80,30);
    back->setStyleSheet("background-color: none; border: none;font-family: 楷体; font-size: 30px; color: #F33333;");
    back->move((x-100), y*0.75);
    connect(back,SIGNAL(clicked()),this,SLOT(close()));

    QVBoxLayout *mainbox=new QVBoxLayout,*finalbox=new QVBoxLayout;
    mainbox->addWidget(interface);

    QHBoxLayout *threepic=new QHBoxLayout,*threeins=new QHBoxLayout,*box=new QHBoxLayout;

    threepic->addWidget(picture[0]);
    threepic->addWidget(picture[1]);

    threeins->addWidget(instruction[0]);
    threeins->addWidget(instruction[1]);

    finalbox->addLayout(threepic);
    finalbox->addLayout(threeins);

    box->addLayout(finalbox);
    box->addWidget(back,50,Qt::AlignBottom);

    interface->setLayout(box);

    this->setLayout(mainbox);

}

instructionwidget::~instructionwidget()
{
}
